﻿// --------------------------------
// <copyright file="InlineTextureList.cs" company="Faculty of Information Technology, Czech Technical University in Prague">
//     This document is shared by Microsoft Public License (MS-PL)
//     For further details please see http://msdn.microsoft.com/en-us/library/ff648068.aspx or license.txt.
// </copyright>
// <author>Lukáš Molnár</author>

// <email>molnaluk@fit.cvut.cz</email>

// <date>9. 11. 2011 22:22:37</date>

// <summary>
//
// </summary>
// --------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using FITClub.Episode1.Configuration;
using FITClub.Util;
using Microsoft.Xna.Framework;

namespace FITClub.TextureMenu
{
#if WINDOWS

    [System.Serializable]
#endif
    /// <summary>
    /// Inline list which displays images.
    /// </summary>
    public class InlineTextureList : InlineList<ModelPreset>
    {
        internal override void DrawItem(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Color tint)
        {
            if (this.HasValues)
            {
                Rectangle r = new Rectangle(this.Bounds.X + offset.X, this.Bounds.Y + offset.Y, this.Bounds.Width - 2 * offset.X, this.Bounds.Height - 2 * offset.Y);
                spriteBatch.Draw(this.SelectedValue.Preview, r, tint);
            }
        }

#if WINDOWS_PHONE == flase

        public override void Resized(double ratioX, double ratioY)
        {
            base.Resized(ratioX, ratioY);
            offset = offset.Scale(ratioX, ratioY);
        }

#endif
    }
}